package L1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class _058 {
    /**
     * 6翻了（正则表达式）
     */
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = reader.readLine();
        line.replaceAll("6{10,}","27");
        line.replaceAll("6{4,}","9");
        System.out.println(line);
    }
}
